From: Michael Albinus Date: Sun, 5 Aug 2007 08:57:24 +0000 (+0000) Subject: * files.el (set-auto-mode): Handle also remote files wrt X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~534^2~3^2~1964 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=f4ef535bcf07af2c5e9a91a38cba6b3312a26a0a;p=emacs.git * files.el (set-auto-mode): Handle also remote files wrt `auto-mode-alist'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cf4daf15b62..4330c92ac6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-05 Michael Albinus + + * files.el (set-auto-mode): Handle also remote files wrt + `auto-mode-alist'. + 2007-08-04 Glenn Morris * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is diff --git a/lisp/files.el b/lisp/files.el index 444e402f438..135ccfafb92 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2259,7 +2259,12 @@ we don't actually set it to the same mode the buffer already has." ;; Next compare the filename against the entries in auto-mode-alist. (unless done (if buffer-file-name - (let ((name buffer-file-name)) + (let ((name buffer-file-name) + (remote-id (file-remote-p buffer-file-name))) + ;; Remove remote file name identification. + (when (and (stringp remote-id) + (string-match remote-id name)) + (setq name (substring name (match-end 0)))) ;; Remove backup-suffixes from file name. (setq name (file-name-sans-versions name)) (while name